import 'package:xinxuan/vo/common_vo/common_pagination_vo.dart';

class WithdrawalListVo {

  List<WithdrawalItem>? data;
  WithdrawalMeta? meta;

  WithdrawalListVo({this.data, this.meta});

  WithdrawalListVo.fromJson(Map<String, dynamic> json) {
    if (json['data'] != null) {
      data = [];
      json['data'].forEach((v) {
        data!.add(new WithdrawalItem.fromJson(v));
      });
    }
    meta = json['meta'] != null ? new WithdrawalMeta.fromJson(json['meta']) : null;
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    if (this.data != null) {
      data['data'] = this.data!.map((v) => v.toJson()).toList();
    }
    if (this.meta != null) {
      data['meta'] = this.meta!.toJson();
    }
    return data;
  }
}

class WithdrawalItem {
  String? cardNumber;
  String? amount;
  int? status;
  String? statusStr;
  String? createdAt;
  String? processingAt;
  String? completedAt;
  String? colsedAt;

  WithdrawalItem(
      {this.cardNumber,
      this.amount,
      this.status,
      this.statusStr,
      this.createdAt,
      this.processingAt,
      this.completedAt,
      this.colsedAt});

  WithdrawalItem.fromJson(Map<String, dynamic> json) {
    cardNumber = json['card_number'];
    amount = json['amount'];
    status = json['status'];
    statusStr = json['status_str'];
    createdAt = json['created_at'];
    processingAt = json['processing_at'];
    completedAt = json['completed_at'];
    colsedAt = json['colsed_at'];
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['card_number'] = this.cardNumber;
    data['amount'] = this.amount;
    data['status'] = this.status;
    data['status_str'] = this.statusStr;
    data['created_at'] = this.createdAt;
    data['processing_at'] = this.processingAt;
    data['completed_at'] = this.completedAt;
    data['colsed_at'] = this.colsedAt;
    return data;
  }
}

class WithdrawalMeta {
  WithdrawalAssets? assets;
  CommonPagination? pagination;

  WithdrawalMeta({this.assets, this.pagination});

  WithdrawalMeta.fromJson(Map<String, dynamic> json) {
    assets =
        json['assets'] != null ? new WithdrawalAssets.fromJson(json['assets']) : null;
    pagination = json['pagination'] != null
        ? new CommonPagination.fromJson(json['pagination'])
        : null;
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    if (this.assets != null) {
      data['assets'] = this.assets!.toJson();
    }
    if (this.pagination != null) {
      data['pagination'] = this.pagination!.toJson();
    }
    return data;
  }
}

class WithdrawalAssets {
  String? available;
  String? withdraw;

  WithdrawalAssets({this.available, this.withdraw});

  WithdrawalAssets.fromJson(Map<String, dynamic> json) {
    available = json['available'];
    withdraw = json['withdraw'];
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['available'] = this.available;
    data['withdraw'] = this.withdraw;
    return data;
  }
}

